package com.hlhj.carview.presenter

import android.content.Context
import com.example.mymvp.mvp.BasePresenter
import com.hlhj.carview.Iview.LoginView
import com.hlhj.carview.bean.LoginBean
import com.hlhj.carview.bean.MyBaseBean
import com.hlhj.carview.module.LoginModule

/**
 * Created by Never Fear   on 2018\12\18 0018.
Never More....
 */
class LoginPresenter:BasePresenter<LoginModule,LoginView>(), LoginView {
    override fun sendSmsResp(myBaseBean: MyBaseBean) {
        view?.sendSmsResp(myBaseBean)
    }

    override fun loginFailed(msg: String) {
        view?.loginFailed(msg)
    }

    override fun loginResp(loginBean: LoginBean) {
        view?.loginResp(loginBean)
    }

    override fun regisResp(myBaseBean: MyBaseBean) {
        view?.regisResp(myBaseBean)
    }

    override fun changePwdResp(myBaseBean: MyBaseBean) {
        view?.changePwdResp(myBaseBean)
    }

    fun changePwd(phone: String, code: String, password: String, confirmPassword:String, c:Context){
        module?.changePwd(phone, code, password, confirmPassword, c)
    }
    fun sendSms(phone:String, c:Context){
        module?.sendSms(phone, c)
    }
    fun regis(phone:String,code:String,password:String,confirmPassword:String,c:Context){
        module?.regis(phone, code, password, confirmPassword, c)
    }
    fun login(phone: String,password: String,c: Context){
        module?.login(phone, password, c)
    }
    override fun createModule() {
        module=LoginModule()
        module.listener=this
    }





}